{% extends 'base.html' %}

{% block content %}
<h1>Mechanism {{ object.id }} details</h1>
<p>You are logged in as {{ object.user.username }}</p>
<style>
  ul.b {
  list-style-type: square;
  line-height:200%;
}
</style>

<ul class="b">
        <li>
          {% if object.ck_mechanism_file %}
            <a href="{{ object.ck_mechanism_file.url }}">{{ object.ck_mechanism_file }}</a>
            <!-- <a href="ace/mechanism">
              <button type="button" class="btn btn-primary btn-sm">Edit</button>
            </a> -->
            <a href="{% url 'upload:delete_file' object.id %}">
              <button type="button" class="btn btn-danger btn-sm">Delete</button>
            </a>
          {% else %}
            <span class="text-muted">No Mechanism File Attached</span>
          {% endif %} 
        </li>
        <li>
          {% if object.ck_thermo_file %}
          <a href="{{ object.ck_thermo_file.url }}">{{ object.ck_thermo_file }}</a>
          <!-- <a href="ace/thermo">
            <button type="button" class="btn btn-primary btn-sm">Edit</button>
          </a> -->
          <a href="delete_thermo">
            <button type="button" class="btn btn-danger btn-sm">Delete</button>
          </a>
          {% else %}
            <span class="text-muted">No Thermo File Attached</span>
          {% endif %}  
        </li>
        <li>
          {% if object.ck_transport_file %}
          <a href="{{ object.ck_transport_file.url }}">{{ object.ck_transport_file }}</a>
          <!-- <a href="ace/transport">
            <button type="button" class="btn btn-primary btn-sm">Edit</button>
          </a> -->
          <a href="delete_transport">
            <button type="button" class="btn btn-danger btn-sm">Delete</button>
          </a>
          {% else %}
            <span class="text-muted">No Transport File Attached</span>
          {% endif %}  
        </li>
        <li>
          {% if object.ck_surface_file %}
          <a href="{{ object.ck_surface_file.url }}">{{ object.ck_surface_file }}</a>
          <!-- <a href="ace/surface">
            <button type="button" class="btn btn-primary btn-sm">Edit</button>
          </a> -->
          <a href="delete_surface">
            <button type="button" class="btn btn-danger btn-sm">Delete</button>
          </a>
          {% else %}
          <span class="text-muted">No Surface File Attached</span>
        {% endif %}  
          </li>
        </ul>

<a href="{% url 'upload:ck2yaml' object.id %}">
  <button type="button" class="btn btn-primary btn-sm">Convert to YAML</button>
</a>
<a href="{% url 'upload:update_file' object.id %}">
  <button type="button" class="btn btn-primary btn-sm">Update Files</button>
</a>

<p><a href="{% url 'upload:list' %}">Back to mechanism list</a></p>

{% endblock %}
